﻿<Window x:Class="Refugees.Views.Windows.Personals"
        xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
        xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
        xmlns:d="http://schemas.microsoft.com/expression/blend/2008"
        xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006"
        xmlns:local="clr-namespace:Refugees.Views.Windows"
        mc:Ignorable="d"
        Title="Персоны" Height="450" Width="800">
    <Window.Resources>
        <Style TargetType="TextBlock">
            <Setter Property="FontSize" Value="20"/>
            <Setter Property="FontStyle" Value="Italic"/>
        </Style>
    </Window.Resources>
    <Grid>
        <Grid.Background>
            <LinearGradientBrush EndPoint="0.5,1" StartPoint="0.5,0">
                <GradientStop Color="#FF819B3D"/>
                <GradientStop Color="#FFA3DAD8" Offset="0.626"/>
            </LinearGradientBrush>
        </Grid.Background>

        <Grid.RowDefinitions>
            <RowDefinition/>
            <RowDefinition Height="4*"/>

            <RowDefinition/>
        </Grid.RowDefinitions>

        <Label Content="Kind Hend" 
                Foreground="Black"
                FontSize="36"
                FontStyle="Italic" 
            VerticalAlignment="Center" HorizontalAlignment="Center"
                FontWeight="Bold" FontFamily="Segoe Script"/>

        <Button Content="Назад" Click="BackClick" HorizontalAlignment="Right" VerticalAlignment="Center" Margin="15" Style="{DynamicResource Vhod}"/>
        <Button x:Name="User" Content="Пользователи" Click="UserClick" HorizontalAlignment="Left" VerticalAlignment="Center" Margin="15" Style="{DynamicResource Vhod}"/>

        <Grid Grid.Row="1" >
            <ListBox Name="PersonalItems" Background="{x:Null}" d:ItemsSource="{d:SampleData ItemCount=5}" BorderBrush="{x:Null}">
                <ListBox.ItemContainerStyle>
                    <Style TargetType="ListBoxItem">
                        <Setter Property="HorizontalAlignment" Value="Stretch"/>
                        <Setter Property="HorizontalContentAlignment" Value="Stretch"/>
                    </Style>
                </ListBox.ItemContainerStyle>
                <ListBox.ItemsPanel>
                    <ItemsPanelTemplate>
                        <StackPanel/>
                    </ItemsPanelTemplate>
                </ListBox.ItemsPanel>
                <ListBox.ItemTemplate >
                    <DataTemplate >
                        <Grid >
                            <Grid.ColumnDefinitions>
                                <ColumnDefinition/>
                                <ColumnDefinition/>
                                <ColumnDefinition/>
                            </Grid.ColumnDefinitions>

                            <Grid>
                                <TextBlock Text="{Binding SNILS}"/>
                            </Grid>
                            
                            <Grid Grid.Column="1">
                                <TextBlock>
                                    <Run Text="{Binding Name}"/>
                                    <Run Text=" "/>
                                    <Run Text="{Binding LastName}"/>
                                    <Run Text=" "/>
                                    <Run Text="{Binding Patronimic}"/>
                                </TextBlock>
                            </Grid>

                            <Grid Grid.Column="2">
                                <Grid.ColumnDefinitions>
                                    <ColumnDefinition/>
                                    <ColumnDefinition/>
                                </Grid.ColumnDefinitions>
                                <Button Click="EnterClick" Content="Выыбрать" Style="{DynamicResource Vhod}"/>
                                <Button Click="EditPersonal" Grid.Column="1" Content="Редактировать" Style="{DynamicResource Vhod}"/>
                            </Grid>
                        </Grid>
                    </DataTemplate>
                </ListBox.ItemTemplate>
            </ListBox>

        </Grid>

        <Button Grid.Row="2"
                Grid.Column="0"
                Content="Добавить"
                Click="AddPersonal"
                VerticalAlignment="Center"  HorizontalAlignment="Center" Style="{DynamicResource Vhod}"/>
    </Grid>
</Window>
